package com.cx.androidtools;

import com.cx.androidtools.entrance.ViewPageActivity;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.ListView;
import android.widget.AdapterView.OnItemClickListener;

public class SlideToolsActivity extends Activity {
	private ListView lv_contents;
	private String[] strs = { "ViewGallery", "ViewFlipper","ViewPageActivity" };
	private Class[] classes = { ViewGalleryActivity.class,
			ViewFlipperActivity.class ,ViewPageActivity.class};

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_main);
		lv_contents = (ListView) findViewById(R.id.lv_contents);
		ArrayAdapter<String> adapter = new ArrayAdapter<String>(this,
				android.R.layout.simple_list_item_1, strs);
		lv_contents.setAdapter(adapter);
		lv_contents.setOnItemClickListener(new OnItemClickListener() {

			@Override
			public void onItemClick(AdapterView<?> arg0, View arg1, int index,
					long arg3) {
				// TODO Auto-generated method stub
				Intent it = new Intent(SlideToolsActivity.this, classes[index]);
				startActivity(it);
			}

		});
	}
}
